#include <iostream>
#include <cstring>
#include <cstdio>

#define max 55
using namespace std;
int main() {
    int n; //格子的规格
    int m;//地毯数量
    int area[max][max];
    //将0赋值到area中“sizeof(area)”中
    memset(area,0,sizeof(area)); //给一块内存段赋值，速度较快
    cin>>n>>m;
    for (int i = 1; i <=m; i++) {
        int x1,y1,x2,y2;  //定义毛毯两个对角坐标
        cin>>x1>>y1>>x2>>y2;
        for (int j = x1; j <=x2 ; j++) {  //遍历x轴
            for (int k = y1; k <=y2 ; k++) { //遍历y轴
                area[j][k]++;  //遍历之后加1表示覆盖过一次
            }
        }
    }
    //遍历整个格子
    for (int i = 1; i <=n ; i++) {
        for (int j = 1; j <= n; j++) {
            cout<<area[i][j]<<(j==n?'\n': ' ');
        }
    }
    return 0;
}
